import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/fonts/iconfont.css'
import './assets/css/base.css'
// import VueRouter from 'vue-router'
import {
  Icon,
  Tabbar,
  TabbarItem,
  Swipe,
  SwipeItem,
  Grid,
  GridItem,
  PullRefresh,
  List,
  NavBar,
  GoodsAction,
  GoodsActionIcon,
  GoodsActionButton,
  Popup,
  Card,
  Stepper,
  Button,
  Form,
  Field,
  Checkbox,
  SwipeCell,
  SubmitBar,
  Empty,
  Sidebar,
  SidebarItem,
  AddressEdit,
  AddressList,
  ContactCard,
  Search,
  Lazyload
} from 'vant'
import img from './assets/img/long.jpg'
import loading from 'plugins/loading'
Vue.use(loading)

Vue.use(Icon)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Stepper)
  .use(Button)
  .use(Form)
  .use(Field)
  .use(Checkbox)
  .use(SwipeCell)
  .use(SubmitBar)
  .use(Empty)
  .use(Sidebar)
  .use(SidebarItem)
  .use(AddressEdit)
  .use(AddressList)
  .use(ContactCard)
  .use(Search)
  .use(Lazyload, {
    loading: img,
    error: '',
    preload: '1'
  })

// const originalPush = VueRouter.prototype.push
// VueRouter.prototype.push = function push (location) {
//   return originalPush.call(this, location).catch(err => err)
// }
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
